From b09fd27a5693089b0408069b37014f81ab6df24b Mon Sep 17 00:00:00 2001 From: "djm@kirby.fc.hp.com" Date: Wed, 14 Dec 2005 13:02:37 -0600 Subject: [PATCH] Mirror changes to x86 un/mask_evtchn --- .../arch/ia64/xen/drivers/evtchn_ia64.c | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c b/linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c index e8f9f863e9..90a7663910 100644 --- a/linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c +++ b/linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c @@ -45,6 +45,47 @@ static struct { */ static spinlock_t irq_mapping_update_lock; +void mask_evtchn(int port) +{ + shared_info_t *s = HYPERVISOR_shared_info; + synch_set_bit(port, &s->evtchn_mask[0]); +} +EXPORT_SYMBOL(mask_evtchn); + +void unmask_evtchn(int port) +{ + shared_info_t *s = HYPERVISOR_shared_info; + unsigned int cpu = smp_processor_id(); + vcpu_info_t *vcpu_info = &s->vcpu_info[cpu]; + +#if 0 // FIXME: diverged from x86 evtchn.c + /* Slow path (hypercall) if this is a non-local port. */ + if (unlikely(cpu != cpu_from_evtchn(port))) { + evtchn_op_t op = { .cmd = EVTCHNOP_unmask, + .u.unmask.port = port }; + (void)HYPERVISOR_event_channel_op(&op); + return; + } +#endif + + synch_clear_bit(port, &s->evtchn_mask[0]); + + /* + * The following is basically the equivalent of 'hw_resend_irq'. Just + * like a real IO-APIC we 'lose the interrupt edge' if the channel is + * masked. + */ + if (synch_test_bit(port, &s->evtchn_pending[0]) && + !synch_test_and_set_bit(port / BITS_PER_LONG, + &vcpu_info->evtchn_pending_sel)) { + vcpu_info->evtchn_upcall_pending = 1; + if (!vcpu_info->evtchn_upcall_mask) + force_evtchn_callback(); + } +} +EXPORT_SYMBOL(unmask_evtchn); + + #define unbound_irq(e) (VALID_EVTCHN(e) && (!evtchns[(e)].opened)) int bind_virq_to_irqhandler( unsigned int virq, -- 2.30.2